package org.cangkuguanli.wangruiqi_bookstore.controller;

import org.cangkuguanli.wangruiqi_bookstore.bean.ShoppingCart;
import org.cangkuguanli.wangruiqi_bookstore.mapper.ShoppingCartMapper;
import org.cangkuguanli.wangruiqi_bookstore.util.JsonResult;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.List;

@RequestMapping("/shopping_cart")
@RestController
public class ShoppingCartController {
    @Resource
    private ShoppingCartMapper shoppingCartMapper;
    @RequestMapping("/find")
    public JsonResult findByUserId(long user_id) {
        List<ShoppingCart> list = shoppingCartMapper.findByUserId(user_id);
        JsonResult result = new JsonResult(true,200,list,"");
        return result;
    }
}
